home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MISC / SHELL.ARC / Shell / Sources / c / Icon < prev    next >
Encoding:
Text File  |  1994-05-17  |  1.5 KB  |  59 lines

  1. #include "Shell.Extra.h"
  2. #include "Shell.Check.h"
  3.  
  4.  
  5. static void    Shell_MakeIconBorder( icon_block *iconblock, char *valid)
  6. {
  7.     static    char nulltext[2] = "\0";
  8.  
  9. iconblock->flags.value |= icon_TEXT | icon_BORDER | icon_INDIRECTED;
  10.  
  11. iconblock->data.indirecttext.buffer = nulltext;
  12. iconblock->data.indirecttext.bufflen = 2;
  13.  
  14. iconblock->data.indirecttext.validstring = valid;
  15. }
  16.  
  17.  
  18.  
  19.  
  20. void Shell_ResizeIconRect( Shell_rectblock *r)
  21.     /* Makes a rect's icon-rect the appropriate size    */
  22.     /* for the rect's rect.                    */
  23.     /* When redrawing rects, the iconrect is checked     */
  24.     /* against the redraw rect so that any icon-border    */
  25.     /* is redrawn correctly.                */
  26. {
  27. /* should check for what type of borer the icon has - these values are ok for
  28.    slab in/out, but don't work for e.g. for r5 (default action button)
  29. */
  30. r->icon.workarearect = r->rect;
  31. if ( r->plot_icon)    {
  32.     r->icon.workarearect.min.x -= 2*Shell_PIXELXSIZE;
  33.     r->icon.workarearect.min.y -= 2*Shell_PIXELYSIZE;
  34.     r->icon.workarearect.max.x += 2*Shell_PIXELXSIZE;
  35.     r->icon.workarearect.max.y += 2*Shell_PIXELYSIZE;
  36.     }
  37.  
  38. Shell_CheckWindSizeAndRedraw( r->window, &r->icon.workarearect);
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45. void    Shell_MakeRectIcon( Shell_rectblock *r, int forecol, int backcol, char *valid)
  46. {
  47. r->plot_icon = TRUE;
  48. r->icon.flags.value = 0;
  49. r->icon.flags.data.foreground = forecol;
  50. r->icon.flags.data.background = backcol;
  51. r->icon.flags.data.filled = ( backcol != colour_TRANSPARENT) ? TRUE : FALSE;
  52. Shell_MakeIconBorder( &r->icon, valid);
  53. Shell_ResizeIconRect( r);
  54. }
  55.  
  56.  
  57.  
  58.  
  59.